<template>
  <div class="main">
    <MeteData :field="field"></MeteData>

    <div class="info-group">
      <div class="group-title">
        服务器名称 serverName
      </div>
      <div class="group-data">
        {{ field.serverName }}
      </div>
    </div>

    <div class="info-group">
      <div class="group-title">
        版本 version
      </div>
      <div class="group-data">
        {{ field.version }}
      </div>
    </div>

    <div class="info-group">
      <div class="group-title">
        命令 cmd
      </div>
      <div class="group-data">
        {{ field.cmd }}
      </div>
    </div>

    <div class="info-group">
      <div class="group-title">
        账号 account
      </div>
      <div class="group-data">
        {{ field.account }}
      </div>
    </div>

    <div class="info-group">
      <div class="group-title">
        密码 passWord
      </div>
      <div class="group-data">
        {{ field.passWord }}
      </div>
    </div>

    <div class="info-group">
      <div class="group-title">
        文件夹名称 dirName
      </div>
      <div class="group-data">
        {{ field.firName }}
      </div>
    </div>

    <div class="info-group">
      <div class="group-title">
        文件名称 fileName
      </div>
      <div class="group-data">
        {{ field.fileName }}
      </div>
    </div>

    <div class="info-group">
      <div class="group-title">
        文件大小 fileSize
      </div>
      <div class="group-data">
        {{ field.fileSize }}
      </div>
    </div>

    <div class="info-group">
      <div class="group-title">
        传输模式 transModel
      </div>
      <div class="group-data">
        {{ transModel }}
      </div>
    </div>

    <div class="info-group">
      <div class="group-title">
        其他信息 otherInfo
      </div>
      <div class="group-data">
        {{ field.otherInfo }}
      </div>
    </div>

    <div class="info-group">
      <div class="group-title">
        执行结果 result
      </div>
      <div class="group-data">
        {{ result }}
      </div>
    </div>

    <div class="info-group">
      <div class="group-title">
        响应码 responseCode
      </div>
      <div class="group-data">
        {{ field.responseCode }}
      </div>
    </div>
  </div>
</template>

<script>
import MeteData from './metaData.vue';

export default {
  name: 'yunche_ftp',
  props: ['field'],
  components: { MeteData },

  data() {
    return {};
  },

  computed: {
    transModel() {
      let ftp_trans = 'NULL';

      switch (this.field.transModel) {
        case 0:
          ftp_trans = '主动传输模式';
          break;

        case 1:
          ftp_trans = '被动传输模式';
          break;

        case 2:
          ftp_trans = '单端口模式';
          break;
      }

      return ftp_trans;
    },

    result() {
      let ftp_result = 'NULL';

      if (this.field.result === 0) {
        ftp_result = '成功';
      } else if (this.field.result === 1) {
        ftp_result = '失败';
      }

      return ftp_result;
    },
  },
};
</script>

<style scoped>
@import '../basicInfo.css';
</style>
